//
//  PPTimelinePictureFlowViewController.m
//  pickpic
//
//  Created by Jinxiao on 10/6/16.
//  Copyright © 2016 MicroDream. All rights reserved.
//

#import "PPTimelinePictureFlowViewController.h"

@interface PPTimelinePictureFlowViewController ()

@end

@implementation PPTimelinePictureFlowViewController

- (void)viewDidLoad {
    [super viewDidLoad];

    self.editing = NO;

    self.view.backgroundColor = [UIColor blackColor];

    self.navigationItem.rightBarButtonItem = [[UIBarButtonItem alloc] initWithImage:[UIImage imageNamed:@"icon-nav-waterfull-yellow"] style:UIBarButtonItemStylePlain target:self action:@selector(switchItemDidPressed)];

    UILabel *titleLabel = [[UILabel alloc] init];
    titleLabel.numberOfLines = 0;
    titleLabel.textAlignment = NSTextAlignmentCenter;
    titleLabel.attributedText = [[NSAttributedString alloc] initWithString:_albumTitle attributes:@{NSFontAttributeName : [UIFont boldSystemFontOfSize:15], NSForegroundColorAttributeName : [UIColor whiteColor]}];;
    [titleLabel sizeToFit];

    self.navigationItem.titleView = titleLabel;
}

- (void)switchItemDidPressed {
    [MobClick event:@"157"];
    [self.navigationController popViewControllerAnimated:NO];
}

- (void)backItemDidPressed {
    UIViewController *viewController = [self.navigationController.viewControllers safeObjectAtIndex:self.navigationController.viewControllers.count - 3];
    [self.navigationController popToViewController:viewController animated:YES];
}

- (void)collectionView:(UICollectionView *)collectionView willDisplayCell:(UICollectionViewCell *)cell forItemAtIndexPath:(NSIndexPath *)indexPath {
    UIImageView *imageView = [cell valueForKey:@"imageView"];
    imageView.backgroundColor = [UIColor colorWithRGBHex:0x1a1a1a];
}

@end
